package com.gesee.zyspps.utils;


import android.graphics.Color;

public class ColorUtil {
	public static int getColorValueFromRGB(String RGBString) {
		int colorValue = 0;
		try {
			colorValue = Color.parseColor(RGBString);
		} catch (Exception e) {
			LogUtil.e("color String is invalid...");
		}
		return colorValue;
	}
	
	public static int[] getComponentFromRGB(int color) {
		int[] rgb = new int[4];
		try {
			rgb[0] = Color.alpha(color);
			rgb[1] = Color.red(color);
			rgb[2] = Color.green(color);
			rgb[3] = Color.blue(color);
		} catch (Exception e) {
			LogUtil.e("color String is invalid...");
			e.printStackTrace();
		}
		return rgb;
	}
	

}
